//:C12:SimpleAssignment.cpp
// Simple operator=()
#include <iostream>
#include <ostream>
using namespace std;
class Value
{
    int a, b;
    float c;
    public:
        Value(int aa = 0, int bb = 0, float cc = 0.0)
            : a(aa), b(bb), c(cc){}
        Value& operator=(const Value & rv)
        {
            a = rv.a;
            b = rv.b;
            c = rv.c;
            return *this;
        }    

        friend ostream&
            operator<<(ostream &os, const Value &rv)
            {
                return os << "a = " << rv.a << ", b = "
                       << rv.b << ", c = " << rv.c;
            }
};

int main(void)
{
    Value a, b(1, 2, 3.3);
    cout << "a: " << a << endl;
    cout << "b: " << b << endl;
    a = b;
    cout << "a after assignment: " << a << endl;
}
